<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>操舱执行登记</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <style>
        ul li,
        ul li div div select,
        ul li div div input {
            font-size: 14px !important;
            ;
        }

        .aui-list-item-label {
            width: 220px !important;
            text-align: center;
        }

        .aui-list-item-input-small {
            width: 140px !important;
            position: relative;
        }

        .aui-list-item-input-small>input {
            width: 90px;
        }

        .aui-list-item-input-small>span {
            position: absolute;
            display: inline-block;
            height: 30px;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
        }

        .aui-list-item-label-width {
            width: 530px !important;
        }

        .aui-list-item-input>label {
            margin-left: 10px;
        }

        .aui-radio {
            margin-right: 10px;
        }

        .aui-radio,
        .aui-checkbox {
            width: 25px !important;
            height: 25px !important;
            margin-right: 5px;
        }

        .textarea-container {
            width: 100%;
            margin: 0 auto;
        }

        .textarea-container>div:nth-child(1) {
            text-align: center;
            font-size: 17px;
        }

        .textarea-container>div:nth-child(2) {
            padding: 10px;
        }

        .textarea-wrapper {
            min-height: 100px;
            border: 1px solid rgba(0, 0, 0, 0.3);
            width: 97%;
            margin: 20px auto 5px auto;
            border-radius: 5px;
        }

        .submit-btn-bottom {
            font-size: 16px;
            margin: 30px auto;
            text-align: center;
        }

        .submit-btn-bottom>button {
            border: none;
            outline: none;
            background-color: #0064B0;
            height: 50px;
            width: 150px;
            color: #fff;
        }
    </style>
</head>

<body>
    <main id="app">
            <div class="aui-content aui-margin-b-15">
                <ul class="aui-list aui-form-list">
                  <li class="aui-list-item">
                      <div class="aui-list-item-inner">
                          <div class="aui-list-item-label">
                              治疗记录编号
                          </div>
                          <div class="aui-list-item-input">
                              <input type="text" placeholder="治疗记录编号" id="F_id">
                          </div>
                      </div>
                      <div class="aui-list-item-inner">

                      </div>
                  </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                姓名
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" placeholder="姓名" id="F_Name">
                            </div>
                        </div>
                        <div class="aui-list-item-inner">
                          <div class="aui-list-item-label">
                              住院号
                          </div>
                          <div class="aui-list-item-input">
                              <input type="text" id="F_zhuyuannumber" placeholder="住院号">
                          </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                性别
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_Sex" placeholder="性别">
                            </div>
                        </div>
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                年龄
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_Age" placeholder="年龄">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                体位
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_tiwei" placeholder="体位">
                            </div>
                        </div>
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                医护陪舱（个）
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_yihu" placeholder="医护陪舱（个）">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                陪护人员（个）
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_peihu" placeholder="陪护人员（个）">
                            </div>
                        </div>
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                吸痰（有，无）
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_xitan" placeholder="吸痰（有，无）">
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                管道
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_guandao" placeholder="管道">
                            </div>
                        </div>
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                吸氧方式
                            </div>
                            <div class="aui-list-item-input">
                                <input type="text" id="F_xiyang" placeholder="吸氧方式">
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
              <div class="submit-btn-bottom">
                  <button onclick="Android_Upd_TreatmentRecord()">修改</button>
              </div>
    </main>
</body>

</html>

<script src="../script/api.js" charset="utf-8"></script>
<script src="../script/vue.js" charset="utf-8"></script>
<script src="../js/ToConfigure.js" charset="utf-8"></script>
<script src="../script/aui-toast.js" charset="utf-8"></script>
<script src="../script/aui-dialog.js" charset="utf-8"></script>
<script type="text/javascript">
    var vm;
    apiready = function() {
        vm = new Vue({
            el: '#app',
            data: {
                checked: false,
                Url_IP: "",
                Query_UserList: [], //舱室操舱人员信息
            },
            created() {

                //获取治疗记录单Id
                this.F_Id = api.pageParam.F_id;



                //获取所属医院IP地址
                this.Url_IP = ToConfigure_IP("Gorgeous");
                //判断是否获取到舱室Id
                if (this.F_Id !== "0") {

                    api.ajax({
                        url: this.Url_IP + 'HyperbaricOxygen/ModuleRecord/Android_Query_TreatmentRecord',
                        method: 'post',
                        data: {
                            values: {
                                F_ID: api.pageParam.F_id
                            }
                        }
                    }, function(ret, err) {
                        if (ret) {
                          //编号
                          document.getElementById("F_id").value = ret[0].F_id;
                          //姓名
                          document.getElementById("F_Name").value = ret[0].aName;
                          //住院号
                          document.getElementById("F_zhuyuannumber").value = ret[0].F_zhuyuannumber;
                          //性别
                          document.getElementById("F_Sex").value = ret[0].sex;
                          //年龄
                          document.getElementById("F_Age").value = ret[0].age;
                          //体位
                          document.getElementById("F_tiwei").value = ret[0].F_tiwei;
                          //医护
                          document.getElementById("F_yihu").value = ret[0].F_yihu;
                          //陪护
                          document.getElementById("F_peihu").value = ret[0].F_peihu;
                          //吸痰
                          document.getElementById("F_xitan").value = ret[0].F_xitan;
                          //管道
                          document.getElementById("F_guandao").value = ret[0].F_guandao;
                          //吸氧
                          document.getElementById("F_xiyang").value = ret[0].F_xiyang;
                        } else {
                            var toast = new auiToast();
                            toast.fail({
                              title: "暂无相关信息",
                              duration: 2000
                            });
                        }
                      }
                  );
                }
            },
            methods: {

            }
        });
    }
    function Android_Upd_TreatmentRecord(){
      var json = GetParameters();
      var Url_IP  = ToConfigure_IP("Gorgeous");
      api.ajax({
          url: Url_IP + 'HyperbaricOxygen/ModuleRecord/Android_Upd_TreatmentRecord',
          method: 'POST',
          data: {
              values: {
                  parms: json
              }
          },
          dataType: 'String',
      }, function(ret, err) {
        if (ret == "True") {
          JumpPage();
        } else {
            var toast = new auiToast();
            toast.fail({
                title: "提交失败",
                duration: 2000
            });
        }
      });
    }

    function GetParameters() {
        var JsParms = new Object()
        JsParms.F_Id = document.getElementById("F_id").value;
        //体位
        JsParms.F_tiwei = document.getElementById("F_tiwei").value;
        //医护陪舱
        JsParms.F_yihu = document.getElementById("F_yihu").value;
        //陪护人员
        JsParms.F_peihu = document.getElementById("F_peihu").value;
        //吸痰
        JsParms.F_xitan = document.getElementById("F_xitan").value;
        //管道
        JsParms.F_guandao = document.getElementById("F_guandao").value;
        //吸氧方式
        JsParms.F_xiyang = document.getElementById("F_xiyang").value;
        return JSON.stringify(JsParms);
    }



    //跳转页面
    function JumpPage() {
        var dialog = new auiDialog();
        dialog.alert({
            title: "提示",
            msg: '操作成功，是否跳转操舱记录单',
            buttons: ['取消', '确定']
        }, function(ret) {
            if (ret.buttonIndex === 1) {

            } else if (ret.buttonIndex === 2) {
                api.historyBack({  }, function(ret, err) {     
                    if (!ret.status) {       
                        api.closeWin();
                    }  
                });
            }
        })
    }
</script>
